#ifndef _CCSKELETALANIMATION_H_
#define _CCSKELETALANIMATION_H_

#include "CCSpineObject.h"
#include "CCTransform.h"
#include "CCSpineGlobal.h"



struct EventData : public CCSpineObject {
    float time;
    const char* name;
    EventData(float t,const char* n) {
        time = t;
        name = n;
    }
    ~EventData() {
    }
};

//class CCSpineLoader;

/**
 * general model of skeletal animation
 */

class CCSkeletalAnimation : public CCSpineObject {
	friend class CCSpineLoader;
	
public:
	/// transform list
	typedef vector<CCTransform*> TransformPtrList;
    
    typedef vector<EventData*> EventPtrList;
	
private:
	/// list of transform
	TransformPtrList m_transList;
	
	/// duration time of this animation
	float m_duration;
    
    EventPtrList m_eventList;
	
protected:
	CCSkeletalAnimation();
	
public:
	virtual ~CCSkeletalAnimation();
	static CCSkeletalAnimation* create();
	
	/// add transform
	void addTransform(CCTransform* t);
	
	/// get list of transform
	TransformPtrList& getTransformList() { return m_transList; }
    
    void addEvent(EventData* data);
    
    EventPtrList& getEventPtrList() { return m_eventList; }
	
	/// get duration time
	float getDuration() { return m_duration; }
};



#endif // __CCSkeletalAnimation_h__
